package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DeclarationGRReportMapper;
import com.ruoyi.system.domain.DeclarationGRReport;
import com.ruoyi.system.service.IDeclarationGRReportService;
import com.ruoyi.common.core.text.Convert;

/**
 * 个人报表Service业务层处理
 * 
 * @author triangle
 * @date 2022-08-13
 */
@Service
public class DeclarationGRReportServiceImpl implements IDeclarationGRReportService 
{
    @Autowired
    private DeclarationGRReportMapper declarationGRReportMapper;

    /**
     * 查询个人报表
     * 
     * @param decId 个人报表主键
     * @return 个人报表
     */
    @Override
    public DeclarationGRReport selectDeclarationGRReportByDecId(Long decId)
    {
        return declarationGRReportMapper.selectDeclarationGRReportByDecId(decId);
    }

    /**
     * 查询个人报表列表
     * 
     * @param declarationGRReport 个人报表
     * @return 个人报表
     */
    @Override
    public List<DeclarationGRReport> selectDeclarationGRReportList(DeclarationGRReport declarationGRReport)
    {
        return declarationGRReportMapper.selectDeclarationGRReportList(declarationGRReport);
    }

    /**
     * 新增个人报表
     * 
     * @param declarationGRReport 个人报表
     * @return 结果
     */
    @Override
    public int insertDeclarationGRReport(DeclarationGRReport declarationGRReport)
    {
        declarationGRReport.setCreateTime(DateUtils.getNowDate());
        return declarationGRReportMapper.insertDeclarationGRReport(declarationGRReport);
    }

    /**
     * 修改个人报表
     * 
     * @param declarationGRReport 个人报表
     * @return 结果
     */
    @Override
    public int updateDeclarationGRReport(DeclarationGRReport declarationGRReport)
    {
        declarationGRReport.setUpdateTime(DateUtils.getNowDate());
        return declarationGRReportMapper.updateDeclarationGRReport(declarationGRReport);
    }

    /**
     * 批量删除个人报表
     * 
     * @param decIds 需要删除的个人报表主键
     * @return 结果
     */
    @Override
    public int deleteDeclarationGRReportByDecIds(String decIds)
    {
        return declarationGRReportMapper.deleteDeclarationGRReportByDecIds(Convert.toStrArray(decIds));
    }

    /**
     * 删除个人报表信息
     * 
     * @param decId 个人报表主键
     * @return 结果
     */
    @Override
    public int deleteDeclarationGRReportByDecId(Long decId)
    {
        return declarationGRReportMapper.deleteDeclarationGRReportByDecId(decId);
    }
}
